@include('admin.public.head')
@include('admin.public.laydate')
@include('admin.public.pop')
<link href="{{ URL::asset('./admin/css/class_base.css') }}" rel="stylesheet">

<style type="text/css">

    .inner_btn {
        background: #19a97b;
        color: white;
        padding: 5px 8px;
        border-radius: 2px;
    }

</style>

<div class="ibox-title">
    <h5>老师安排</h5>
    </br>
    <div class="class_base">
            <p>
                教室：{{$class_bass_info['classsroom']['numbering']}}</br>
                課程：{{$class_bass_info['class_base']['class_name']}}</br>
                周期：{{$class_bass_info['class_week']}}</br>
                時段：{{$class_bass_info['class_time']['time_start']}}~{{$class_bass_info['class_time']['time_end']}}</br>
            </p>
    </div>
</div>

<div class="ibox-content">
    @if(permission('/class_base_info_teacher_add', $user['right_list'], $user['get_routes']))
        <div class="row">
            <div class="col-sm-12 clear">
                <div class="" style="margin: 0 10px">
                    <a href="/class_base_info_teacher_add/{{$id}}" class="btn btn-w-m btn-primary">新增</a>
                </div>
            </div>
        </div>
    @endif
    <div class="row">
        <div class="col-sm-12 pull-right m-b-xs">
            <form action="">
                <div class="col-sm-1  m-b-xs text-center pull-right">
                    <button type="submit" class="btn btn-sm btn-primary">搜索</button> </span>
                </div>

                <div class="col-sm-2 text-center pull-right">
                    <input type="text" name="teacher_name" value="{{$teacher_name}}" placeholder="老師名稱" class="input form-control">
                </div>

                <div class="col-sm-2 text-center pull-right">
                    <input type="text" name="class_time" id="start_time" value="{{$class_time}}" placeholder="上課時間查詢" class="input form-control">
                </div>

            </form>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>上課老師</th>
            <th>上課時間</th>
            <th>是否公共</th>
            <th>編輯</th>
        </tr>
        </thead>
        <tbody>
            @foreach ($class_bass_info_teacher as $k=>$v)
                <tr>
                    <td>
                        {{$v->teacher->teacher_name??''}}
                    </td>
                    <td>
                        @if(!empty($v->designated_date))
                            @foreach($v->designated_date as $vv)
                                {{$vv}}</br>
                            @endforeach
                        @endif
                    </td>
                    <td>
                        @if($v->is_common == 1)公共@endif
                        @if($v->is_common == -1)不是公共@endif
                    </td>
                    <td>
                        <a  class="btn btn-primary btn-sm dropdown-toggle" url="/class_base_info_teacher_del/{{$id}}/{{$v->teacher->id}}" onclick="del($(this))" href="javascript:void(0)">刪除
                        </a>
                    </td>
                </tr>
            @endforeach
            {{ $class_bass_info_teacher->appends(Request::except ('page'))->links() }}
        </tbody>
        {{ $class_bass_info_teacher->appends(Request::except ('page'))->links() }}
    </table>
</div>
<script>
</script>
